package org.nvframe.event.eventtype;

import org.nvframe.event.AbstractEvent;
import org.nvframe.event.EventListener;
import org.nvframe.exception.NVFrameException;

/**
 * 
 * @author Nik Van Looy
 */
public class SoundEvent extends AbstractEvent {

	private static Class<? extends EventListener> listener = SoundListener.class;
	
	private String soundId;

	public SoundEvent(String soundId) {
		// set event-specific properties
		this.soundId = soundId;
	}
	
	public void dispatchToListener(EventListener listener) {
		try {
			((SoundListener) listener).playSound(this);
		} catch (NVFrameException e) {
			e.printStackTrace();
		}
	}

	public String getSoundId() {
		return soundId;
	}

	@Override
	protected Class<? extends EventListener> getListener() {
		return listener;
	}

}
